package com.yan.Service;

import com.yan.Dao.BookMapper;
import com.yan.Pojo.Books;

import java.util.List;

public class BookServiceImpl implements BookService {

   //service 业务层去调用 dao层 组合dao

    private BookMapper bookMapper;
    public void setBookMapper(BookMapper bookMapper) {
        this.bookMapper = bookMapper;
    }

    @Override
    public int addBooks(Books books) {
        return bookMapper.addBooks(books);    }

    @Override
    public int delectBookById(int id) {
        return bookMapper.delectBookById(id);
    }

    @Override
    public int updateBook(Books books) {
        System.out.println("books1==>"+books);
        return bookMapper.updateBook(books);
    }

    @Override
    public Books queryBookById(int id) {
        return bookMapper.queryBookById(id);
    }

    @Override
    public List<Books> queryAllBook() {
        return bookMapper.queryAllBook();
    }

    @Override
    public Books queryBookName(String bookName) {
        return bookMapper.queryBookName(bookName);
    }
}
